package chai.ning.compare.train_13;

public class Phoenix implements Comparable<Phoenix> {
	private String name;
	private int age;
	private char gender;

	public Phoenix(String name, int age, char gender) {
		super();
		this.name = name;
		this.age = age;
		this.gender = gender;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public char getGender() {
		return gender;
	}

	public void setGender(char gender) {
		this.gender = gender;
	}

	public int compareTo(Phoenix another) {
		if (this.age < another.age) {
			return -250;
		} else if (this.age == another.age) {
			return age;
		} else {
			return 250;
		}
	}

	@Override
	public String toString() {
		return "Phoenix name：" + this.name + "   age：" + this.age + "   gender：" + this.gender + "";
	}

}
